//
//  SubmitOrderCell.m
//  ForestPack
//
//  Created by jimmy on 2018/7/18.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "SubmitOrderCell.h"
#import "SimpleHeaderView.h"
#import "MayLikeView.h"
#import "UIView+Utils.h"
#import "SearchRecordViewController.h"

@implementation SubmitOrderCell

+(SubmitOrderCell *)cellWithTable:(UITableView *)tableView withIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellID = @"SubmitOrderCell";
    SubmitOrderCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[SubmitOrderCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.backgroundColor = [UIColor whiteColor];
        [cell createSubView];
    }
    return cell;
}



-(void)createSubView
{
    SimpleHeaderWithBtn *headerView = [SimpleHeaderWithBtn headerViewWithTitle:@"您可能还需要" withHeight:54];
    headerView.frame = CGRectMake(0, 0, SCREEN_WIDTH, ScreenX375(54));
    [self addSubview:headerView];
    headerView.moreClick = ^{
        if (self->_moreCommodityClick) {
            self->_moreCommodityClick();
        }
    };
    
    CGFloat width = (SCREEN_WIDTH - ScreenX375(39)) / 2;
    for (int i = 0; i < 4; i++) {
        MayLikeView *view = [[MayLikeView alloc] initWithFrame:CGRectMake(i % 2 * (width + ScreenX375(13)) + ScreenX375(13), i / 2 * ScreenX375(175) + ScreenX375(45), width, ScreenX375(165))];
        view.mayNeedClick = ^{
            if (self->_commodityDetailClick) {
                self->_commodityDetailClick();
            }
        };
        
        [self addSubview:view];
    }
}

@end


@interface SubmitOrderSuccessCell()

@end

@implementation SubmitOrderSuccessCell

+(SubmitOrderSuccessCell *)cellWithTable:(UITableView *)tableView withIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellID = @"SubmitOrderSuccessCell";
    SubmitOrderSuccessCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[SubmitOrderSuccessCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.backgroundColor = [UIColor whiteColor];
        [cell createSubView];
    }
    return cell;
 
}

-(void)createSubView
{
    UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(ScreenX375(100), ScreenX375(10), SCREEN_WIDTH - ScreenX375(200), SCREEN_WIDTH - ScreenX375(200))];
    imageV.image = [UIImage imageNamed:@"提交成功"];
    [self addSubview:imageV];
    
    UILabel *alertLabel = [[UILabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - ScreenX375(80))/2, imageV.bottom, ScreenX375(80), ScreenX375(18))];
    alertLabel.textAlignment = NSTextAlignmentCenter;
    alertLabel.text = @"提交成功";
    alertLabel.textColor = FONTCOLOR_BLACK;
    alertLabel.font = Kfont(18);
    [self addSubview:alertLabel];
    
    UILabel *matchLabel = [[UILabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - ScreenX375(110))/2, alertLabel.bottom, ScreenX375(110), ScreenX375(18))];
    matchLabel.textAlignment = NSTextAlignmentCenter;
    matchLabel.text = @"正在匹配设计师";
    matchLabel.textColor = RGB_COLOR(153,153,153);
    matchLabel.font = Kfont(14);
    [self addSubview:matchLabel];
}

@end

